// 田地丈量 未提交提交
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1 = max(x1, 0);
    y1 = max(y1, 0);
    x2 = min(x2, a);
    y2 = min(y2, b);
    if (x1 > x2 || y1 > y2)
      continue;
    int area = (x2 - x1) * (y2 - y1);
    sum += area;
  }
  cout << sum;
  return 0;
}